﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using BUS;

namespace FastDeal.Control
{
    public partial class wuc_KhuyenMaiDaDang : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int loai = int.Parse(Request.QueryString["MaKhuyenMai"].ToString());
                LayDanhSachTheoDaDang(loai);
            }
            catch
            {
                LayDanhSachTheoDaDang(0);
            }
        }

        private void LayDanhSachTheoDaDang(int loai)
        {
            IQueryable loai1;
            KhuyenMai_BUS db = new KhuyenMai_BUS();
            loai1 = db.LayDanhSachTheoDaDang(loai);
            DTDaDang.DataSource = loai1; 
            DTDaDang.DataBind();

        }
    }
}